package com.china.springServer.desigen.factory.before;

public class CoffeeStore {

    public Coffee orderCoffee(String type) {
        Coffee coffee = null;
        if (type.equals("latte")) {
            coffee = new LatteCoffee();
        } else if (type.equals("american")) {
            coffee = new AmericanCoffee();
        } else {
            throw new RuntimeException();
        }
        coffee.addSugar();
        coffee.addMilk();
        return coffee;
    }

}
